﻿<UserControl x:Class="CodeAbility.MonitorAndCommand.WpfMonitor.UserControls.DS18B20"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="250" d:DesignWidth="250">
    
    <UserControl.Resources>
        <Style x:Key="TemperatureStyle" TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="5,5"/>
            <Setter Property="FontSize" Value="48"/>
            <Setter Property="Foreground" Value="White"/>
        </Style>
    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>

        <TextBlock Text="DS18B20" Style="{StaticResource DeviceNameStyle}"></TextBlock>
        <TextBlock Grid.Row="1" Text="{Binding Temperature, StringFormat='\{0\}°c', FallbackValue='N/A'}" Style="{StaticResource TemperatureStyle}"/>

    </Grid>
</UserControl>
